package test.com.sky.arrayCopy;

/**
 * @author : wushikai
 * <p>
 * date : 2022-05-27
 */
public class ArrayCloneDemo {


    public static void main(String[] args) {
        int[] arr = {7, 8, 9};
        int[] cloneArr = arr.clone();//调用数组的clone()方法，将数组复制一份，  cloneArr将指向复制出来的数组
        arr[2] = 777;
        cloneArr[2] = 888;
        System.out.println("The third number of arr is: " + arr[2]);
        System.out.println("The third number of cloneArr is: " + cloneArr[2]);

    }


}
